﻿using Basic.FlowCollect;
using Basic.FlowLocalEvent.Model;
using WeDonekRpc.Client.Attr;
using WeDonekRpc.Client.Interface;

namespace Basic.FlowLocalEvent.FlowNode
{
    [LocalEventName("Delete")]
    internal class ClearFormDataRelation : IEventHandler<FlowNodeEvent>
    {
        private readonly INodeFormDataRelationCollect _Service;

        public ClearFormDataRelation ( INodeFormDataRelationCollect service )
        {
            this._Service = service;
        }

        public void HandleEvent ( FlowNodeEvent data, string eventName )
        {
            this._Service.ClearByNodeId(data.Node.Id);
        }
    }
}
